// export function getStorage(key){
// 	return window.localStorage.getItem(key)
// }

// export function setStorage(key,val){
// 	window.localStorage.setItem(key,typeof val !=='string'?JSON.stringify(val):val)
// }

// export function delStorage(key){
// 	window.localStorage.removeItem(key)
// }

// export function cleStorage(key){
// 	window.localStorage.clear()
// }

let storage = {
  get(key) {
    return window.sessionStorage.getItem(key);
  },
  set(key, val) {
    window.sessionStorage.setItem(
      key,
      typeof val !== "string" ? JSON.stringify(val) : val
    );
  },
  del(key) {
    window.sessionStorage.removeItem(key);
  },
  cle() {
    window.sessionStorage.clear();
  }
};

export default storage;
